from abc import ABC, abstractmethod
from dataclasses import dataclass
from typing import Optional
from enum import Enum

class OrderType(Enum):
    LIMIT = "LIMIT"
    MARKET = "MARKET"

class OrderStatus(Enum):
    SUBMITTED = "SUBMITTED"
    FILLED = "FILLED"

@dataclass
class OrderRequest:
    symbol: str
    order_type: OrderType
    volume: float
    price: Optional[float] = None

@dataclass
class OrderResponse:
    order_id: str
    status: OrderStatus
    msg: str = ""

class UnifiedExecutionGateway(ABC):
    @abstractmethod
    def connect(self): pass
    
    @abstractmethod
    def send_order(self, order_req: OrderRequest) -> OrderResponse: pass
    
    @abstractmethod
    def query_position(self): pass